其他
Python到底是强类型语言,还是弱类型语言?
The following article is from Python猫 Author 豌豆花下猫
作者 | 豌豆花下猫
前言
动静类型与强弱类型
强类型:Java、C#、Python、Ruby、Erlang(再加GO、Rust)…… 弱类型:C、C++、Javascript、Perl、PHP、VB……
过去的强弱类型概念
In 1974, Liskov and Zilles defined a strongly-typed language as one in which "whenever an object is passed from a calling function to a called function, its type must be compatible with the type declared in the called function."[3] In 1977, Jackson wrote, "In a strongly typed language each data area will have a distinct type and each process will state its communication requirements in terms of these types."[4]
现在的强弱类型概念
Strongly checked language: A language where no forbidden errors can occur at run time (depending on the definition of forbidden error). Weakly checked language: A language that is statically checked but provides no clear guarantee of absence of execution errors.
A weakly typed language has looser typing rules and may produce unpredictable results or may perform implicit type conversion at runtime.
Python 是不是强类型语言?
其它相关的问题
小结
相关链接:
推荐阅读:
如何从Windows切换到Linux今天起,属于Windows 7的时代结束了...
使用 Windows 六年后,我后悔了
每日打卡赢积分兑换书籍入口
👇🏻👇🏻👇🏻